package com.gt.service.impl;

import com.gt.constant.MessageConstant;
import com.gt.constant.StatusConstant;
import com.gt.mapper.BookMapper;
import com.gt.mapper.BorrowMapper;
import com.gt.mapper.CategoryMapper;
import com.gt.mapper.EmployeeMapper;
import com.gt.pojo.vo.CategoryListVO;
import com.gt.pojo.vo.NewStudentsVO;
import com.gt.service.reportService;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
@Slf4j
public class reportServiceImpl implements reportService {

    @Autowired
    private EmployeeMapper employeeMapper;
    @Autowired
    private BorrowMapper borrowMapper;
    @Autowired
    private BookMapper bookMapper;
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public Integer getUserStatistics() {
        Integer count = employeeMapper.getByUser(MessageConstant.USER);
        return count;
    }

    @Override
    public Integer getBorrowList() {

        Integer count = borrowMapper.getByStatus(StatusConstant.RETURNED);
        return count;
    }

    @Override
    public List<CategoryListVO> getCategoryList() {

        return categoryMapper.getCategoryName();
    }

    @Override
    public List<NewStudentsVO> getNewStudentsByDate() {
        return employeeMapper.getNewStudentsByDate();
    }
}
